home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sacred & Secular
/
Sacred and Secular.iso
/
pc
/
movies
/
shared.dir
/
05031_Script_5031
< prev
next >
Wrap
Text File
|
1996-04-03
|
5KB
|
171 lines
global datafirstline,findlist
--on findnext thetext,wherenow
-- put findall(thetext) into theplaces
-- sort theplaces
-- if the number of words in theplaces = 0 then return ""
-- put findposnear(theplaces,value(wherenow)+1) into theplace
-- if theplace = count(theplaces) then
-- return getat(theplaces,1)
-- else
-- return getat(theplaces,theplace+1)
-- end if
--end
--on findprev thetext,wherenow
-- put findall(thetext) into theplaces
-- sort theplaces
-- if the number of words in theplaces = 0 then return ""
-- put findposnear(theplaces,value(wherenow)) into theplace
-- if theplace = 0 then
-- return getat(theplaces,(count(theplaces)))
-- else
-- return getat(theplaces,theplace)
-- end if
--end
on findall thetext
cursor 4
put false into somethingmissing
put the number of words in thetext into wordcount
set p = []
repeat with a = 1 to the number of words in thetext
put wordplaces(word a of thetext) into wp
if wp = "" then
put true into somethingmissing
exit repeat
end if
repeat with w = 1 to the number of items in wp
append(p,value(item w of wp))
end repeat
end repeat
set np = []
if somethingmissing = true then
cursor -1
return np
end if
append(p,100000000000)
sort p
if wordcount > 1 then
put count(p)-1 into c
repeat with a = 1 to c
put 0 into match
put getat(p,a) into thisone
repeat with w = 1 to wordcount-1
if a+w > c then exit repeat
if getat(p,a+w) = thisone then
put match + 1 into match
else
exit repeat
end if
end repeat
if match >= wordcount-1 then append(np,thisone)
end repeat
cursor -1
return np
else
deleteat(p,count(p))
cursor -1
return p
end if
cursor -1
end
on wordplaces theword
put char 1 of theword & "words" into thecast
if the number of cast thecast < 1 then return ""
put offset(return&theword&",",return & field thecast) into theoffset
if theoffset = 0 then return ""
put line(the number of lines in char 1 to theoffset of field thecast) of field thecast into theline
delete item 1 of theline
return theline
end
on finddescription theplaces
cursor 4
set finddescriptions = ""
repeat with a = 1 to count(theplaces)
put line (getat(theplaces,a)) of field "Find descriptions" into line a of finddescriptions
end repeat
cursor -1
return finddescriptions
end
-- *** lisa's code
on searchfortext
global gFindAllResults -- DMD added
cursor 4
set the castnum of sprite 7 = 126 -- the number of cast "retLIT"
updatestage
set datafirstline = 1
put the text of field 4786 into temptext -- cast "ENTERTEXT"
--DMD put finddescription (findall (temptext)) into hold
set gFindAllResults = findall (temptext)
put finddescription (gFindAllResults) into hold
put hold into field 4787 -- cast "DATA"
PUT LINE datafirstline TO (datafirstline + 4) OF field 4787 into cast 4788
-- FIELD "DATA" INTO CAST "DATA2"
put RETURN after field 4788 -- field "DATA2"
set the castnum of sprite 7 = 125 -- the number of cast "ret"
UPDATESTAGE
cursor -1
end searchfortext
--keydownscript
on findfeature
if the key = RETURN then
--if the frame > 266 and the frame < 280 then
if the visible of sprite 4 = true then
searchfortext
exit
end if
-- end if
else
checkKeys
end if
end
on gotoframe mline
global gFindAllResults
if mLine < 1 then set mLine = 1
if mLine = 6 then set mLine = 5
put ">>>gotoFrame " & mLine
cursor -4
repeat with i = 4 to 8
set the visible of sprite i to false
end repeat
set the visible of sprite 22 to false
-- set temptext = the text of field "ENTERTEXT"
-- set templist = findall(temptext)
-- DMD
set templist = gFindAllResults
set error = 0
if voidP(tempList) then set error = 1
else if count(tempList) = 0 or (mline + datafirstline - 1) > count(tempList) then set error = 1
if error then
beep
exit
end if
set mline = (mline + datafirstline) -1
set templistno = getat(templist,mline)
set framename = getat(findlist,templistno)
put ">>>goToFrame " & frameName
go framename
-- set the text of cast "ENTERTEXT" to ""
-- set the text of cast "DATA" to ""
-- set the text of cast "DATA2" to ""
cursor -1
end gotoframe